Skip to content

[io] Add buffer bound checks in TFile::Recover#22190

Open
silverweed wants to merge 5 commits into
root-project:masterfrom
silverweed:tfile_init_oob
Open

[io] Add buffer bound checks in TFile::Recover#22190
silverweed wants to merge 5 commits into
root-project:masterfrom
silverweed:tfile_init_oob

Conversation

@silverweed

@silverweed silverweed commented May 8, 2026

Copy link
Copy Markdown
Contributor

TODO

  • add tests
  • decide if we want/need to use the safer overloads elsewhere

This PR fixes #22169

@silverweed silverweed requested a review from jblomer May 8, 2026 13:10
@silverweed silverweed self-assigned this May 8, 2026
@silverweed silverweed force-pushed the tfile_init_oob branch 4 times, most recently from 668624f to 33f969c Compare May 8, 2026 13:46
@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown

Test Results

    22 files      22 suites   3d 13h 44m 3s ⏱️
 3 873 tests  3 873 ✅ 0 💤 0 ❌
76 480 runs  76 480 ✅ 0 💤 0 ❌

Results for commit 5e6bdc2.

♻️ This comment has been updated with latest results.

@silverweed silverweed marked this pull request as ready for review May 11, 2026 09:31
Comment thread io/io/src/TKey.cxx Outdated
@silverweed silverweed added this to the 6.40.02 milestone May 19, 2026
@dpiparo dpiparo modified the milestones: 6.40.02, 6.40.04 Jun 9, 2026
This prevents potential oob stack reads in case of corrupted TFiles
- Declare variables when they're used
- Spare a needless dynamic allocation
- Use memcpy instead of frombuf in a loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[io] TFile::Recover doesn't properly validate read lengths

3 participants